/*
 * Created by 岱青海蓝信息系统(北京)有限公司 on 17-2-20 上午10:11
 * Copyright (c) 2017. All rights reserved.
 */

package com.example.dqhl.recycleviewdemo.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.example.dqhl.recycleviewdemo.R;
import com.tuyenmonkey.mkloader.MKLoader;

public class MkLoaderActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tv_click;
    private MKLoader mkLoader;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ok_http_demo);
        initView();
    }

    private void initView() {
        (tv_click) = (TextView) findViewById(R.id.tv_click);
        tv_click.setOnClickListener(this);
        (mkLoader) = (MKLoader) findViewById(R.id.mkLoader);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_click:
                mkLoader.setVisibility(View.GONE);
                break;

        }
    }

    /**
     * 简单的POST请求
     *
     * */
//    OkHttpClient client = new OkHttpClient();
//    RequestBody body = new FormEncodingBuilder()
//            .add("token", "2247c10bcb157099ecc29ce4a10e2174")
//            .build();
//    final Request request = new Request.Builder()
//            //2247c10bcb157099ecc29ce4a10e2174
//            .url(Constant.index_isBind)
//            .post(body)
//            .build();
//        client.newCall(request).enqueue(new Callback() {
//        @Override
//        public void onFailure(Request request, IOException e) {
//            Log.i("GG", request.body().toString());
//        }
//
//        @Override
//        public void onResponse(Response response) throws IOException {
//            if (response.isSuccessful()) {
//                Log.i("GG", request.body().toString());
//
//            }
//        }
//    });
}
